set line [gets stdin]
scan $line "%d%d%d" n m k

set k [expr $k - 1]
set ans [expr ($k % $n) * $m + ($k / $n) + 1]
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    int n,m,k;
    while(cin>>n>>m>>k){
          int y=k/n,x=k%n;
          if(x)y++;
          else x=n;
          //cout<<"x="<<x<<" y="<<y<<endl;
          if(y)cout<<(x-1)*m+y<<endl;
          else cout<<x*m<<endl;         
          }
    return 0;
    }
